<template>
  <div class="app-container" style="width:1250px; margin:0px auto">
      <el-row>
          <el-col :span="24"><el-image  :src="require('@/assets/images/logo.png')" ></el-image></el-col>

      </el-row>
      <el-row>
          <el-col :span="24">
<div class="line"></div>
<el-menu
  class="el-menu-demo"
  mode="horizontal"
  background-color="#545c64"
  text-color="#fff" router
  active-text-color="#ffd04b">
  <el-menu-item index="/index">商城首页</el-menu-item>
  <el-menu-item index="/introduce/1">关于我们</el-menu-item>
  <el-submenu index="3">
    <template slot="title">区域查看</template>
     <el-menu-item v-for="item in top_thingtype2" :key="item.id"  :index="'/thing2/'+item.id">{{item.type}}</el-menu-item>
  </el-submenu>
  <el-submenu index="4">
      <template slot="title">分类查看</template>
      <el-menu-item v-for="item in top_thingtype" :key="item.id"  :index="'/thing/'+item.id">{{item.type}}</el-menu-item>
    </el-submenu>
  <el-menu-item index="/news">商城资讯</el-menu-item>
  <el-menu-item index="/introduce/2">联系我们</el-menu-item>
  <el-menu-item index="/buying">购物车</el-menu-item>
    <el-submenu index="client" v-if="this.$store.state.admin.author==null||this.$store.state.admin.author=='client'">
    <template slot="title" >会员中心</template>
     <el-menu-item v-if="this.$store.state.admin.author=='client'"  index="/client/buy/list0">会员中心</el-menu-item>
     <el-menu-item v-if="this.$store.state.admin.author==null" index="/web/reg">会员注册</el-menu-item>
     <el-menu-item v-if="this.$store.state.admin.author==null" index="/web/login/client">会员登录</el-menu-item>
  </el-submenu>
</el-menu>
</el-col>

      </el-row>

      <el-row v-if="$route.meta.show">
          <el-col>
              <el-carousel :interval="5000" arrow="always">
                <el-carousel-item v-for="item in imgs" :key="item">
                <h3><el-image  :src="item" ></el-image></h3>
                </el-carousel-item>
            </el-carousel>
          </el-col>
      </el-row>
  </div>
</template>

<script>
    export default{
        data(){
            return{
                top_thingtype2:this.$store.state.config.thingtype2,
                top_thingtype:this.$store.state.config.thingtype,
                imgs:[require('@/assets/images/b1.jpg'),require('@/assets/images/b2.jpg'),require('@/assets/images/b3.jpg')]
            }
        },
        created(){
            console.log("author:%s,token:%d",this.$store.state.admin.author,this.$store.state.admin.token)
        },
watch: {
    $route (to, from) {
      this.$router.go(0)
    }
  },
    }
</script>

<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 18px;
    opacity: 0.75;
    line-height: 300px;
    margin: 0;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }
</style>
